package com.glsc.ngateway.common.api.platform.feign;

import com.glsc.ngateway.common.api.common.config.FeignMultipartSupportConfig;
import com.glsc.ngateway.common.api.platform.dto.system.SystemConfigDto;
import com.glsc.ngateway.common.api.platform.dto.system.SystemMainDto;
import com.glsc.ngateway.common.api.platform.dto.user.PlatformUserDto;
import com.glsc.ngateway.common.api.platform.resp.PlatformResponse;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "eureka-client-platform", configuration = FeignMultipartSupportConfig.class)  // 调用的服务的名称
public interface IFeignPlatformService {

    @RequestMapping(value = "/gatewayApi/user/findByAccount", method = RequestMethod.GET)
    PlatformResponse<PlatformUserDto> findByAccount(@RequestParam("account") String account);

    /**
     * 通过系统标识list查找系统
     */
    @RequestMapping(value = "/gatewayApi/system/main/findAllBySystemIdIn", method = RequestMethod.GET)
    PlatformResponse<List<SystemMainDto>> findAllBySystemIdIn(@RequestParam("systemIdList") List<String> systemIdList);


    @RequestMapping(value = "/gatewayApi/user/findByUserName", method = RequestMethod.GET)
    PlatformResponse<String> findByUserName(@RequestParam("userName") String userName);

    @GetMapping("/gatewayApi/api/systemConfig/findByCode")
    PlatformResponse<SystemConfigDto> findConfigByCode(@ApiParam(value = "配置code") @RequestParam(value = "configCode", required = false) String configCode);
}
